package com.clone.surpassli.clone_cloudreader.app;

import android.app.Application;
import android.content.res.Configuration;
import android.content.res.Resources;

import com.clone.surpassli.clone_cloudreader.utils.DebugUtil;
import com.clone.surpassli.library.HttpUtils;

/**
 * Created by SurpassLi on 2017/9/29.
 * CloneCloudReaderApplication
 */

public class CloneCloudReaderApplication extends Application{
    private static CloneCloudReaderApplication sCloneCloudReaderApplication;

    public static CloneCloudReaderApplication getInstance(){
        return sCloneCloudReaderApplication;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        sCloneCloudReaderApplication = this;
        HttpUtils.getInstance().init(this, DebugUtil.DEBUG);
        initTextSize();
    }

    /**
     * 使系统更改字体大小无效
     */
    private void initTextSize(){
        Resources resources = getResources();
        Configuration configuration = new Configuration();
        configuration.setToDefaults();
        resources.updateConfiguration(configuration, resources.getDisplayMetrics());
    }
}